package serverMessage;
import time.LogicalTimeStamp;
import time.VectorTimeStamp;

/**
 * This is the ServerMulticastMessage message that a server sends after
 *  it has obtained the Write Multual Exclusion to tell other servers
 *  to register a certain user in their database
 */
public class WriteCommand extends ServerMessage {
	private static final long serialVersionUID = -6445556277576949796L;
	private String username;
	private String password;
	private byte[] bytes;
	private int bg;
	private String nickname;

	public WriteCommand(String username, String password, LogicalTimeStamp msgTS) {
		super(ServerMessage.WRITE_COMMAND, msgTS);
		this.username = username;
		this.password = password;
	}

	public String getUsername(){	return this.username;	}
	public String getPassword(){	return this.password;	}
	
	public byte[] getBytes() {
		return bytes;
	}
	public void setBytes(byte[] bytes) {
		this.bytes = bytes;
	}
	
	public int getBG() {
		return bg;
	}
	public void setBG(int bg) {
		this.bg = bg;
	}
	
	public String getNickname() {
		return nickname;
	}
	public void setNickname(String nickname) {
		this.nickname = nickname;
	}
	
	public String toString(){
		return "WriteCommand. " + " username=" + this.username + " password=" + this.password;
	}
}
